import Cookies from "js-cookie";
// App
const sidebarStatusKey = "sidebar_status";
export const getSidebarStatus = () => Cookies.get(sidebarStatusKey);
export const setSidebarStatus = (sidebarStatus: string) =>
  Cookies.set(sidebarStatusKey, sidebarStatus);

const languageKey = "language";
export const getLanguage = () => Cookies.get(languageKey);
export const setLanguage = (language: string) =>
  Cookies.set(languageKey, language);

const sizeKey = "size";
export const getSize = () => Cookies.get(sizeKey);
export const setSize = (size: string) => Cookies.set(sizeKey, size);

// User
const tokenKey = "X-Access-Token";
export const getToken = () => Cookies.get(tokenKey);
export const setToken = (token: string) =>
  Cookies.set(tokenKey, token, { expires: 7 });
export const removeToken = () => {
  console.log("removeToken");
  Cookies.remove(tokenKey);
};

// datasource
const sourceKey = "datasource-Key";
export const getSourceKey = () => Cookies.get(sourceKey);
export const setSourceKey = (token: string) => Cookies.set(sourceKey, token);
export const removeSourceKey = () => Cookies.remove(sourceKey);
